package com.sfh.dog.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.sfh.dog.R;
import com.sfh.dog.entity.LeftMenuEntity;

/***
 * 左侧菜单
 * @author sWX229906
 *
 */
public class LeftMenuAdapter extends LBaseAdapter<LeftMenuEntity, LeftMenuAdapter.HondlerView>
{
    public LeftMenuAdapter(Context context, List<LeftMenuEntity> list)
    {
        
        super(context, R.layout.main_left_item,list);
        
     
    }
    
    static class HondlerView
    {
        ImageView ivIcon;
        
        TextView tvName;
    }
    
    @Override
    public HondlerView findHondView(View view)
    {
        HondlerView mHondlerView = new HondlerView();
        mHondlerView.ivIcon = (ImageView)view.findViewById(R.id.ivIcon);
        mHondlerView.tvName = (TextView)view.findViewById(R.id.tvName);
        return mHondlerView;
    }
    
    @Override
    public void setViewData(LeftMenuEntity t, HondlerView hondler, int position)
    {
        hondler.ivIcon.setImageResource(t.r);
        hondler.tvName.setText(t.name);
        
    }
}
